export default {
  inject: ['getGraph', 'getNode'],
  mounted() {
    const node = this.getNode();
    // 监听数据改变事件
    node.on('change:data', () => {
      this.form = this.getNode().getData();
    });
  },
  data() {
    return {
      form: this.getNode().getData()
    };
  },
  computed: {
    showData() {
      return this.form;
    },
    showActors() {
      let actors = [];
      if (this.form.actors) {
        actors = this.form.actors[this.form.candidateUsers];
      }
      return actors;
    },
    nodeStatus() {
      // 图标三种状态
      // norun 未运行
      // run 正在运行
      // over 已运行
      return this.form.nodeStatus ? this.form.nodeStatus : '';
    }
  }
};
